#include <QObject>
#include <QWidget>
#include <QPainter>
#include <QPen>
#include <QBrush>
#include <QPainterPath>
#include <QLinearGradient>
#include <QMatrix>
#include "MyWidget.h"

void MyWidget::paintEvent(QPaintEvent *event){
	QPainter painter(this);
	
	
	
	painter.setRenderHint(QPainter::Antialiasing, true);
	painter.setPen(QPen(Qt::black, 12, Qt::DashDotLine, Qt::RoundCap));
	painter.setBrush(QBrush(Qt::green, Qt::SolidPattern));
	painter.drawEllipse(80, 80, 400, 240);
	
	QLinearGradient gradient(400, 240, 500, 350);
	gradient.setColorAt(0.0, Qt::white);
	gradient.setColorAt(0.2, Qt::blue);
	gradient.setColorAt(1.0, Qt::black);
	
	painter.setBrush(gradient);
	painter.drawEllipse(400, 240, 500, 340);
	
	QPainterPath path;
	path.moveTo(80, 320);
	path.cubicTo(200, 80, 320, 80, 480, 320);
	painter.setPen(QPen(Qt::black, 8));
	painter.drawPath(path);
	
	QMatrix matrix;
//	matrix.translate(-10.0, -20.0);
	matrix.rotate(45.0);
//	matrix.translate(+10.0, +20.0);
	painter.setMatrix(matrix)n;
	painter.drawLine(150,150,400,400);
	painter.drawText(150,150,400,400, Qt::AlignCenter, tr("Revenue"));
}

